Skip to content

fix(devex): keep the admin console audit log at info - #131086

Merged
trunk-io[bot] merged 1 commit into
masterfrom
fix/devex-console-audit-log-level
Nov 6, 2026
Merged

trunk-io[bot] merged 1 commit into
masterfrom
fix/devex-console-audit-log-level

Conversation

@webjunkie

Copy link
Copy Markdown
Contributor

Problem

Changes

  • The posthog.admin.console logger gets its own INFO level, like the other INFO diagnostics under posthog.* in settings/logs.py.

How did you test this code?

  • Checked after django.setup() with the SDK loaded: posthog stays at WARNING, and posthog.admin.console.views and posthog.admin.console.organization_tools are enabled for INFO.

Release status

  • No feature flag controls this change

Docs update

  • None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, claude-opus-5-5

Skills: /writing-pr-descriptions

The posthoganalytics SDK claims the "posthog" logger name and clamps it to
WARNING. The console writes its audit lines (operation started/finished,
with the actor and the reason staff gave) at INFO under posthog.admin.console,
so none of them reached the logs. Give the console package its own INFO level,
the same way other INFO diagnostics under posthog.* already do.

Found by Dan Marchuk in #130856.
@trunk-io

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@parameterai

parameterai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Risk: No findings

This PR adds an explicit INFO logging config for posthog.admin.console, un-clamping the staff audit trail that the posthoganalytics SDK's WARNING clamp on the posthog logger was suppressing. The only risk surface is what that logger now emits, and it is the intended audit content (staff email, operation, reason) with no secrets.

Sentinel reviewed bc901c6 · Review settings

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

⚠️ Playwright — 1 flaky

🎭 Playwright report · View test results →

⚠️ 1 flaky test:

  • Delete a notebook from the list (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this section? Help fix flakies and failures and it will go green!

webjunkie added a commit that referenced this pull request Nov 6, 2026
Master landed its own tool operations (#130715, #130716) while this branch
built an inline version of the same thing. Master's design wins where both
built it:

- ToolOperation, its handler protocol, the operation page at
  /tools/<tool>/<op>/, gate, preview via ConfirmStep and the signed token,
  and result pages all come from master. The inline OperationForm block,
  _fill_operation_forms and the POST path in tool_page are dropped, so tool
  pages stay read-only (@require_safe).
- check_danger replaces check_danger_contract.
- Live replaces Page.refresh_seconds and the meta refresh in base.html.
- posthog/settings/logs.py takes master's version; the audit log level fix
  lands in #131086.

Kept from this branch, adapted to master's block rendering (_block.html):

- Filters (GET form, field groups and their contract check), Stats/Stat,
  Links/Link, Notice.tone (callout, now also shows the notice link),
  Table.title/numeric_columns/scrolls, Cell.detail
- data-pending-label loading labels in console.js
- the "Incidents" tool group
- Live can hold a Stats block too, so a status row can follow running work

Tests: the inline-operation cases now hit master's operation URL, which
keeps coverage master lacks for tool operations (offered lookup, query kept
on redirect, refusal re-renders the form, CSRF). The ToolOperation danger
and Filters contract cases stay.

AGENTS.md and the extending-the-admin-console skill describe master's
operation model plus the new blocks. console.css rebuilt.

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

The audit-logging change has current-head independent review with no findings. No unresolved substantive concerns or other refusal grounds are present.

  • Author wrote 0% of the modified lines and has 43 merged PRs in these paths (familiarity MODERATE).
  • PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
size ✓ 2L, 1F substantive — within ceiling
tier ✓ T1-agent / T1a-trivial (2L, 1F, single-area, fix)
stamphog 2.7.0 .stamphog/policy.yml @ bc901c6 · reviewed head bc901c6

@trunk-io
trunk-io Bot merged commit d96b049 into master Nov 6, 2026
272 checks passed
@trunk-io
trunk-io Bot deleted the fix/devex-console-audit-log-level branch November 6, 2026 18:10
@deployment-status-posthog

deployment-status-posthog Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-11-06 18:52 UTC Run
prod-us ✅ Deployed 2026-11-06 19:12 UTC Run
prod-eu ✅ Deployed 2026-11-06 19:12 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant